package com.atcumt.Huawei;

import java.util.Arrays;
import java.util.Scanner;

/**
 * 字符串排序
 * 给定 n 个字符串，请对 n 个字符串按照字典序排列
 */
public class HJ8 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = Integer.valueOf(sc.nextLine());

        String[] strs = new String[n];
        for (int i = 0; i < n; i++) {
            strs[i] = sc.nextLine();
        }

        Arrays.sort(strs);

        for (String s : strs) {
            System.out.println(s);
        }

    }
}
